<template>
	<div id='tmpl'>
			<div class="title">
				<h4>{{info.title}}</h4>
				<p>{{info.add_time | datefmt('YYYY-MM-DD')}} {{info.click}}次浏览</p>
			</div>
			<div id="content" v-html='info.content'></div>
	</div>
</template>
<script>
export default {
	name: "newsinfo",
	data () {
		return {
			id:0,
			info:{}
		};
	},
	methods:{
			getnewsInfo:function(){
				var url = this.$common+'/api/getnew/'+this.id;
				this.$http.get(url).then(function(res){
					var data = res.body;
					if(data.status != 0){
						Toast(data.message)
            return;
					};
					this.info = data.message[0];
				})
			}	
		},
	created:function(){
		this.id=this.$route.params.id;
			this.getnewsInfo()
	}
}
</script>
<style lang="css" scoped>
.title{margin-bottom: 20px}
.title h4{
	color:#0094FF;
}
.title p{
	color:rgba(0,0,0,.5);

}
#tmpl{	padding: 5px; }
</style>